package com.koron.tool.frame;

import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.beans.PropertyVetoException;

import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

import com.koron.tool.MainFrame;

public class ResourceAction extends AbstractAction {
	private MainFrame frame;

	public ResourceAction(MainFrame frame) {
		putValue(NAME, "打开目录文件");
		this.frame = frame;
		putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK+InputEvent.ALT_MASK));
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		ResourceFrame inf = new ResourceFrame(frame);
			frame.getDesktop().add(inf);
			try {
				inf.setSelected(true);
			} catch (PropertyVetoException e1) {
		}
	}
}
